<template>
  <div>汤姆:{{ count }}</div>
</template>

<script>
import bus from '../../../utils/eventBus'
export default {
  data() {
    return {
    //   count: 0
    }
  },
  computed: {
    count() {
      return this.$store.state.tomCount
    }
  },
  mounted() {
    bus.$on('add-tom', data => {
      this.count += data
    })
  }
}
</script>

<style>

</style>
